home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 5
/
Apprentice-Release5.iso
/
Source Code
/
C++
/
Code Resources
/
Windows 95 MDEF
/
Sourcery
/
DrawMenuItem.h
< prev
next >
Wrap
Text File
|
1996-06-12
|
2KB
|
97 lines
enum {
kRectPadding = 1, // Padding between menu item & whole menu
kHeightPadding = 3, // Vertical padding between text & menu item (x2)
kWidthPadding = 6, // Horizontal padding between text & menu item (x2)
kTextHtPadding = -1, // Vertical offset for "balanced" menu item text
kCmdKeyPadding = 6, // Horizontal padding added if has cmd key
kItemMarkPadding = 4 // Horizontal padding added if has item mark
};
enum {
kSubMenuPadding = 12, // Horizontal padding added if has submenu
kSubMenuHt = 7, // Height of submenu triangle
kSubMenuWd = 4 // Width of submenu triangle
};
// A menu item can be in one of three states:
// 1) selected, or
// 2) unselected, or
// 3) disabled...
enum {
kMenuHilited = true,
kMenuUnhilited = false,
kMenuDisabled = -1
};
enum {
kMenuFont = geneva,
kMenuSize = 12,
kMenuFace = 0,
kSysTextMode = srcOr
};
enum {
kBlack = 0, // Some RGBColor constants
kWhite = 65535,
kLtGray = 56797, // light (56797) or darker (48059)
kDkGray = 17467 // 17467 (lighter) or darker (8738)
};
enum {
kCheckMarkChar = '√',
kWidestChar = 'W',
kCmdKeyChar = 17,
kDividerChar = '-'
};
/*
Codes in the cmdkey field of a menu item which
have special meanings and aren't to be taken as
command key characters.
*/
enum {
kSubmenuCode = 0x001B, // same as hMenuCmd
kScriptCode = 0x001C,
kUseICONCode = 0x001D,
kUseSICNCode = 0x001E
};
enum {
kDefaultMDEFparametersID = 0,
kDefaultMDEFparametersType = 'MnuT'
};
// MDEFparameters resource
typedef struct {
RGBColor menuBkgndColor;
RGBColor menuHiliteColor;
RGBColor menuShadowColor;
short menuFont;
short menuSize;
short menuFace;
short exactWin95Look;
short reserved;
RGBColor menuSelectionColor; // Usually same as menuShadowColor
} MDEFparameters;
// MDEFstuff struct.
// Used for keeping track of menu colors, from function to function,
// since we aren't allowed to have globals (though we can if we want
// to, using the A4 register).
typedef struct {
RGBColor black;
RGBColor white;
MDEFparameters params;
} MDEFstuff;
void GetMenuItemRect(Rect *menuRect, Rect *itemRect, short whichItem);
Boolean IsItemDisabled(MenuHandle whichMenu, short whichItem);
void DrawMenuItem(MenuHandle whichMenu, Rect *menuRect, short whichItem,
short hiliteState, MDEFstuff *mdefData);